#include "../include/steiner.h"

/* retorna o somatorio dos pesos das arestas do grafo */
int custo(graph * G) {
  int custoTot;
  
  int v, w;
  
  custoTot = 0;
  
  for (v = 0; v < G->TotalNodes; v++) {
    for (w = v; w < G->TotalNodes; w++) {
      if (G->adjacency[v][w] >= 0) {
	custoTot = custoTot + G->adjacency[v][w];
      };
    };
  };
  
  if (custoTot > 0) {
    return custoTot;
  } else {  
    return MAX_CST;
  };
};
